Optimal. Leaf size=109 \[ -\frac {(A-i B) \tanh ^{-1}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )}{\sqrt {2} \sqrt {a} d}-\frac {A+i B}{d \sqrt {a+i a \tan (c+d x)}}-\frac {2 i B \sqrt {a+i a \tan (c+d x)}}{a d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.10, antiderivative size = 109, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 4, integrand size = 34, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.118, Rules used = {3673, 3607,
3561, 212} \begin {gather*} -\frac {A+i B}{d \sqrt {a+i a \tan (c+d x)}}-\frac {(A-i B) \tanh ^{-1}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )}{\sqrt {2} \sqrt {a} d}-\frac {2 i B \sqrt {a+i a \tan (c+d x)}}{a d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 212
Rule 3561
Rule 3607
Rule 3673
Rubi steps
\begin {align*} \int \frac {\tan (c+d x) (A+B \tan (c+d x))}{\sqrt {a+i a \tan (c+d x)}} \, dx &=-\frac {2 i B \sqrt {a+i a \tan (c+d x)}}{a d}+\int \frac {-B+A \tan (c+d x)}{\sqrt {a+i a \tan (c+d x)}} \, dx\\ &=-\frac {A+i B}{d \sqrt {a+i a \tan (c+d x)}}-\frac {2 i B \sqrt {a+i a \tan (c+d x)}}{a d}-\frac {(i A+B) \int \sqrt {a+i a \tan (c+d x)} \, dx}{2 a}\\ &=-\frac {A+i B}{d \sqrt {a+i a \tan (c+d x)}}-\frac {2 i B \sqrt {a+i a \tan (c+d x)}}{a d}-\frac {(A-i B) \text {Subst}\left (\int \frac {1}{2 a-x^2} \, dx,x,\sqrt {a+i a \tan (c+d x)}\right )}{d}\\ &=-\frac {(A-i B) \tanh ^{-1}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )}{\sqrt {2} \sqrt {a} d}-\frac {A+i B}{d \sqrt {a+i a \tan (c+d x)}}-\frac {2 i B \sqrt {a+i a \tan (c+d x)}}{a d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 1.43, size = 140, normalized size = 1.28 \begin {gather*} -\frac {e^{-2 i (c+d x)} \sqrt {\frac {a e^{2 i (c+d x)}}{1+e^{2 i (c+d x)}}} \left (A \left (1+e^{2 i (c+d x)}\right )+i B \left (1+5 e^{2 i (c+d x)}\right )+(A-i B) e^{i (c+d x)} \sqrt {1+e^{2 i (c+d x)}} \sinh ^{-1}\left (e^{i (c+d x)}\right )\right )}{\sqrt {2} a d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.10, size = 88, normalized size = 0.81
method | result | size |
derivativedivides | \(\frac {-2 i B \sqrt {a +i a \tan \left (d x +c \right )}-\frac {\sqrt {a}\, \left (-i B +A \right ) \sqrt {2}\, \arctanh \left (\frac {\sqrt {a +i a \tan \left (d x +c \right )}\, \sqrt {2}}{2 \sqrt {a}}\right )}{2}-\frac {a \left (i B +A \right )}{\sqrt {a +i a \tan \left (d x +c \right )}}}{a d}\) | \(88\) |
default | \(\frac {-2 i B \sqrt {a +i a \tan \left (d x +c \right )}-\frac {\sqrt {a}\, \left (-i B +A \right ) \sqrt {2}\, \arctanh \left (\frac {\sqrt {a +i a \tan \left (d x +c \right )}\, \sqrt {2}}{2 \sqrt {a}}\right )}{2}-\frac {a \left (i B +A \right )}{\sqrt {a +i a \tan \left (d x +c \right )}}}{a d}\) | \(88\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.54, size = 110, normalized size = 1.01 \begin {gather*} \frac {\sqrt {2} {\left (A - i \, B\right )} a^{\frac {3}{2}} \log \left (-\frac {\sqrt {2} \sqrt {a} - \sqrt {i \, a \tan \left (d x + c\right ) + a}}{\sqrt {2} \sqrt {a} + \sqrt {i \, a \tan \left (d x + c\right ) + a}}\right ) - 8 i \, \sqrt {i \, a \tan \left (d x + c\right ) + a} B a - \frac {4 \, {\left (A + i \, B\right )} a^{2}}{\sqrt {i \, a \tan \left (d x + c\right ) + a}}}{4 \, a^{2} d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 327 vs. \(2 (84) = 168\).
time = 2.72, size = 327, normalized size = 3.00 \begin {gather*} \frac {{\left (\sqrt {2} a d \sqrt {\frac {A^{2} - 2 i \, A B - B^{2}}{a d^{2}}} e^{\left (i \, d x + i \, c\right )} \log \left (-\frac {4 \, {\left ({\left (-i \, A - B\right )} a e^{\left (i \, d x + i \, c\right )} + {\left (i \, a d e^{\left (2 i \, d x + 2 i \, c\right )} + i \, a d\right )} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} \sqrt {\frac {A^{2} - 2 i \, A B - B^{2}}{a d^{2}}}\right )} e^{\left (-i \, d x - i \, c\right )}}{i \, A + B}\right ) - \sqrt {2} a d \sqrt {\frac {A^{2} - 2 i \, A B - B^{2}}{a d^{2}}} e^{\left (i \, d x + i \, c\right )} \log \left (-\frac {4 \, {\left ({\left (-i \, A - B\right )} a e^{\left (i \, d x + i \, c\right )} + {\left (-i \, a d e^{\left (2 i \, d x + 2 i \, c\right )} - i \, a d\right )} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} \sqrt {\frac {A^{2} - 2 i \, A B - B^{2}}{a d^{2}}}\right )} e^{\left (-i \, d x - i \, c\right )}}{i \, A + B}\right ) - 2 \, \sqrt {2} {\left ({\left (A + 5 i \, B\right )} e^{\left (2 i \, d x + 2 i \, c\right )} + A + i \, B\right )} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}}\right )} e^{\left (-i \, d x - i \, c\right )}}{4 \, a d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\left (A + B \tan {\left (c + d x \right )}\right ) \tan {\left (c + d x \right )}}{\sqrt {i a \left (\tan {\left (c + d x \right )} - i\right )}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 7.38, size = 141, normalized size = 1.29 \begin {gather*} -\frac {A}{d\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}}-\frac {B\,1{}\mathrm {i}}{d\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}}-\frac {B\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}\,2{}\mathrm {i}}{a\,d}-\frac {\sqrt {2}\,B\,\mathrm {atan}\left (\frac {\sqrt {2}\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}}{2\,\sqrt {-a}}\right )\,1{}\mathrm {i}}{2\,\sqrt {-a}\,d}-\frac {\sqrt {2}\,A\,\mathrm {atanh}\left (\frac {\sqrt {2}\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}}{2\,\sqrt {a}}\right )}{2\,\sqrt {a}\,d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________